package com.factory.factorymethod.self.order;

import com.factory.factorymethod.self.pizza.Cake;
import com.factory.factorymethod.self.pizza.CheeryCake;
import com.factory.factorymethod.self.pizza.HerdCake;


public class VegationOrderCake extends OrderPizza{
    @Override
    public Cake createCake(String type) {
        System.out.println("使用抽象工厂模式!");
        Cake cake;
        if(type.equals("cheery")){
            cake = new CheeryCake();
        }else if(type.equals("herd")) {
            cake = new HerdCake();
        } else {
            cake = null;
        }
        return cake;
    }
}
